/*
 *配置接口请求参数
 * @Author: 舒克
 * @Official Accounts: 氧化1028
 * @email: 143587623@qq.com
 * @github: https://gitee.com/KingSio
 * @Date: 2021-01-14 16:54:47
 * @LastEditTime: 2021-01-20 14:29:53
 * @FilePath: \Vue全栈后台\项目\vue_shop\src\api\request.js
 */
import axios from "../api/axios"
//配置get请求，参数在body上使用
export function getData(url,type,data){
    if(type==="get"){
        return axios({
            url:url,
            method:type,
            params:data
        })
    }else{
        return axios({
            url:url,
            method:type,
            data
        })
    }
}
//参数拼接在url后面使用
export function getPriceData(url,type,data) {
    return axios({
      // url: '/xxxx' + id,
      url: url+data,
      method:type,

    })


}

export function Data(url,type,data) {
  if(type === 'get') {
    return axios({
      url: url,
      // url: '/cmpp-gray-manage' + url,
      method: type,
      params: data,
      responseType: 'blob',
    })
  }
  else {
    return axios({
      // url: '/cmpp-gray-manage' + url,
      url: url,
      method: type,
      data
    })
  }

} 